<<<<<<< HEAD
// course/pages/info/index.js
const $api = require("../../../api/course").API

Page({

  /**
   * 页面的初始数据
   */
  data: {
    videoSrc:"",
    platformSrc:"https://img01.yzcdn.cn/vant/apple-1.jpg",
    chapterindex:0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var t = this
    t.setData({
      id:options.id
    })
    t.getCourseInfo()
    t.getChapterList()
  },

  gotochoosenum(e){
    var t = this
    console.log(e)
    wx.navigateTo({
      url:'/course/pages/choosenum/index'
    })
  },
  getCourseInfo(){
    var t = this,
    data = {
      course_id:t.data.id,
      member_id:wx.getStorageSync('user').member_id
    }
    $api.getCourseInfo(data).then(res=>{
      console.log(res)
      t.setData({
        info:res.data
      })
    })
  },
  // 根据专辑id获取选集列表
  getChapterList(){
    var t = this,
    data = {
      online_course_muster_id:t.data.id,
      member_id:wx.getStorageSync('user').member_id
    }
    $api.getCourseChapter(data).then(res=>{
      wx.setStorageSync('CourseChapterlists', res.data)
      t.setData({
        CourseChapterlists:res.data
      })
    })
  },
=======
// course/pages/info/index.js
const $api = require("../../../api/course").API

Page({

  /**
   * 页面的初始数据
   */
  data: {
    videoSrc:"",
    platformSrc:"https://img01.yzcdn.cn/vant/apple-1.jpg",
    chapterindex:0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var t = this
    t.setData({
      id:options.id
    })
    t.getCourseInfo()
    t.getChapterList()
  },

  gotochoosenum(e){
    var t = this
    console.log(e)
    wx.navigateTo({
      url:'/course/pages/choosenum/index'
    })
  },
  getCourseInfo(){
    var t = this,
    data = {
      course_id:t.data.id,
      member_id:wx.getStorageSync('user').member_id
    }
    $api.getCourseInfo(data).then(res=>{
      console.log(res)
      t.setData({
        info:res.data
      })
    })
  },
  // 根据专辑id获取选集列表
  getChapterList(){
    var t = this,
    data = {
      online_course_muster_id:t.data.id,
      member_id:wx.getStorageSync('user').member_id
    }
    $api.getCourseChapter(data).then(res=>{
      wx.setStorageSync('CourseChapterlists', res.data)
      t.setData({
        CourseChapterlists:res.data
      })
    })
  },
>>>>>>> 1c9ce1fdc7fcbf1a028b999eb3cd07f698a8a329
})